From: Florian Müllner Date: Fri, 8 Mar 2019 13:08:27 +0000 (+0100) Subject: texture-cache: Fall back to actor size for bound textures X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~879^2^2~6 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=d86d3bbe54348d17e5a2e81896f6a74019877cb6;p=gnome-shell.git texture-cache: Fall back to actor size for bound textures With StImageContent, the meaning of passing -1 as size parameter changed from "load the image at its preferred size" to "abort the session". It is therefore no longer possible to just load the image and then have it scaled by applying a CSS size to the texture's parent. Setting the size from CSS is useful though, so to still allow that, fall back to the actor's size (which can be determined by the style). https://gitlab.gnome.org/GNOME/gnome-shell/issues/1027 --- diff --git a/src/st/st-texture-cache.c b/src/st/st-texture-cache.c index fa5b1f04a..61f76accc 100644 --- a/src/st/st-texture-cache.c +++ b/src/st/st-texture-cache.c @@ -700,10 +700,14 @@ st_texture_cache_reset_texture (StTextureCachePropertyBind *bind, { g_autoptr(ClutterContent) image = NULL; g_autoptr(GError) error = NULL; + int size = bind->size; + + if (size < 0) + clutter_actor_get_preferred_width (bind->actor, -1, NULL, (float *)&size); image = clutter_actor_get_content (bind->actor); if (!image || !CLUTTER_IS_IMAGE (image)) - image = st_image_content_new_with_preferred_size (bind->size, bind->size); + image = st_image_content_new_with_preferred_size (size, size); else g_object_ref (image);